
class StuDent{//类
    public String name;//成员变量
    public int age;

    public void fun(){//成员方法
        System.out.println("名字：" + name + " 年龄："+age);
    }

}
public class Test {
    public static void main(String[] args) {
        StuDent stuDent = new StuDent();//实例化
        stuDent.name = "张三";//赋值
        stuDent.age = 18;
        stuDent.fun();//调用方法
        System.out.println("================");
        StuDent stuDent1 = new StuDent();
        stuDent1.name = "王鹏";
        stuDent1.age = 28;
        stuDent1.fun();
    }
}
